package com.wfm.leetcode.editor.cn;

import com.wfm.common.TreeNode;

public class PTwo26翻转二叉树{
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public TreeNode invertTree(TreeNode root) {
        if(root==null) return null;

        TreeNode left = invertTree(root.left);
        TreeNode right = invertTree(root.right);

        root.left=right;
        root.right=left;
        return root;
    }
}
//leetcode submit region end(Prohibit modification and deletion)

    public static void main(String[] args) { 
        Solution solution = new PTwo26翻转二叉树().new Solution();
    }
}